package com.wm.web.controller.system;


import com.wm.common.core.controller.BaseController;
import com.wm.common.core.domain.AjaxResult;
import com.wm.common.core.page.TableDataInfo;
import com.wm.system.domain.BrandLibrary;
import com.wm.system.service.IBrandLibraryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 品牌库 前端控制器
 * </p>
 *
 * @author hyq
 * @since 2023-10-21 16:34:02
 */
@RestController
@RequestMapping("/system/brandLibrary")
public class BrandLibraryController extends BaseController {

    @Autowired
    private IBrandLibraryService service;

    @ApiOperation("品牌分页查询")
    @GetMapping("list")
    public TableDataInfo list(BrandLibrary brandLibrary){
        startPage();
        List<BrandLibrary> libraryList = service.selectBrandLibraryList(brandLibrary);
        return getDataTable(libraryList);
    }

    @ApiOperation("品牌新增和修改")
    @PostMapping("addOrUpdate")
    public AjaxResult addOrUpdate(@RequestBody BrandLibrary brandLibrary){
        service.addOrUpdate(brandLibrary);
        return AjaxResult.success();
    }

}
